package top.lucky.common;

public enum EnumAddressReplenish {

    NMG("内蒙古", "内蒙古自治区"),
    GX("广西", "广西壮族自治区"),
    XZ("西藏", "西藏自治区"),
    NX("宁夏", "宁夏回族自治区"),
    XJ("新疆", "新疆维吾尔自治区");

    /** 不完整的地址 */
    private String incompleteAddress;
    /** 完整的地址 */
    private String completeAddress;

    EnumAddressReplenish(String incompleteAddress, String completeAddress) {
        this.incompleteAddress = incompleteAddress;
        this.completeAddress = completeAddress;
    }

    /**
     * 查找
     *
     * @param incompleteAddress
     * @author yeshuai
     * @date 2021/11/23 16:39
     */
    public static EnumAddressReplenish find(String incompleteAddress) {
        for (EnumAddressReplenish e : EnumAddressReplenish.values()) {
            if (e.getIncompleteAddress().equals(incompleteAddress)) {
                return e;
            }
        }
        return null;
    }

    public String getIncompleteAddress() {
        return incompleteAddress;
    }

    public String getCompleteAddress() {
        return completeAddress;
    }
}

